package com.example.event_resource_java.commons.util;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstantPropertiesUtil implements InitializingBean {

 //   @Value("${jinzhi.oss.aliyun.endpoint}")
    private String endpoint;
  ///  @Value("${jinzhi.oss.aliyun.accessKeyId}")
    private String keyid;
  //  @Value("${jinzhi.oss.aliyun.accessKeySecret}")
    private String keysecret;
   // @Value("${jinzhi.oss.aliyun.bucketName}")
    private String bucketname;
  //  @Value("${jinzhi.oss.aliyun.bucketpath}")
    private String bucketpath;

    //
    //常量值
    public static String END_POINT;
    public static String ACCESS_KEY_ID;
    public static String ACCESS_KEY_SECRET;
    public static String BUCKET_NAME;
    //资源访问地址
    public static String BUCKET_PATH;

    @Override
    public void afterPropertiesSet() throws Exception {
        //赋值
        END_POINT=endpoint;
        ACCESS_KEY_ID=keyid;
        ACCESS_KEY_SECRET=keysecret;
        BUCKET_NAME=bucketname;
        BUCKET_PATH=bucketpath;
    }
}
